package com.sansui.admin.core.model;

import java.io.Serializable;

import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import com.sansui.admin.core.groups.UserAdd;
import com.sansui.admin.core.groups.UserUpdate;

import lombok.Data;

@Data
@Table(name = "system_user")
public class User implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7484136779753770396L;
	@NotNull(groups = { UserUpdate.class }, message = "id不能为空")
	private String id;
	@NotNull(groups = { UserUpdate.class, UserAdd.class }, message = "username不能为空")
	private String username;
	@NotNull(groups = { UserUpdate.class, UserAdd.class }, message = "password不能为空")
	private String password;

	public User(String id, String username, String password) {
		super();
		this.id = id;
		this.username = username;
		this.password = password;
	}

	public User() {

	}

	@Override
	public String toString() {
		return "User [id=" + id + ", username=" + username + ", password=" + password + "]";
	}

	/**
	 * @Title:
	 * @Description:
	 * @param id
	 * @param username
	 */
	public User(String id, String username) {
		super();
		this.id = id;
		this.username = username;
	}

}